﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ScrumTracker.Model;

namespace ScrumTrackerAjax.Controllers
{
    public class StoriesController : AbstractController
    {
        [HttpPost]
        public ActionResult Create(Story model)
        {
            if (ModelState.IsValid)
            {
                model = Story.Create(model);
                return PartialView("_StoryListItem", model);
            }
            else
            {
                Response.StatusCode = (int)System.Net.HttpStatusCode.BadRequest;
                return PartialView("_CreateStoryForm", model);
            }
        }
    }
}
